<html>
<head><meta charset="utf-8"><title>Making quickfixes out of assists · t-compiler/rust-analyzer · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/index.html">t-compiler/rust-analyzer</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Making.20quickfixes.20out.20of.20assists.html">Making quickfixes out of assists</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="203638055"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Making%20quickfixes%20out%20of%20assists/near/203638055" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Timo Freiberg <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Making.20quickfixes.20out.20of.20assists.html#203638055">(Jul 12 2020 at 10:39)</a>:</h4>
<p>Hey everyone, I've been fixing an issue with the <code>fix_visibility</code> assist and I want to do some refactoring while I'm there - namely turning it into a quickfix.<br>
I guess I'll have to first generate a diagnostic, right? Does anyone already have a rough idea where such a diagnostic could be created?</p>



<a name="203650837"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Making%20quickfixes%20out%20of%20assists/near/203650837" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jeremy Kolb <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Making.20quickfixes.20out.20of.20assists.html#203650837">(Jul 12 2020 at 16:43)</a>:</h4>
<p><code>fix_visibility</code> should already be a quickfix: <a href="https://github.com/rust-analyzer/rust-analyzer/blob/f51b0cfdd6c23dd57a0a11154179730171c0425d/crates/ra_assists/src/handlers/fix_visibility.rs#L61">https://github.com/rust-analyzer/rust-analyzer/blob/f51b0cfdd6c23dd57a0a11154179730171c0425d/crates/ra_assists/src/handlers/fix_visibility.rs#L61</a></p>



<a name="203650928"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Making%20quickfixes%20out%20of%20assists/near/203650928" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Jeremy Kolb <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Making.20quickfixes.20out.20of.20assists.html#203650928">(Jul 12 2020 at 16:45)</a>:</h4>
<p>Are you using vscode? If not you'll need to make sure that your client is sending down that it supports the capability</p>



<a name="203652379"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Making%20quickfixes%20out%20of%20assists/near/203652379" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Timo Freiberg <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Making.20quickfixes.20out.20of.20assists.html#203652379">(Jul 12 2020 at 17:21)</a>:</h4>
<p>well, it's currently an assist, not a quickfix. see the discussion in this ticket: <a href="https://github.com/rust-analyzer/rust-analyzer/issues/4563">https://github.com/rust-analyzer/rust-analyzer/issues/4563</a></p>



<a name="203981355"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Making%20quickfixes%20out%20of%20assists/near/203981355" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Timo Freiberg <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Making.20quickfixes.20out.20of.20assists.html#203981355">(Jul 15 2020 at 16:47)</a>:</h4>
<p>hmm, I've been reading through the code a little bit, trying to find if <code>Visibility</code> is used somewhere in the analysis where I could maybe generate a new Diagnostic, and so far all usages of <code>Visibility</code> that I found were for autocompletion/find usages/fix visibility.<br>
does RA currently ignore visibility, leaving visibility errors completely up to <code>cargo check</code>?</p>



<a name="203983776"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Making%20quickfixes%20out%20of%20assists/near/203983776" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Florian Diebold <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Making.20quickfixes.20out.20of.20assists.html#203983776">(Jul 15 2020 at 17:08)</a>:</h4>
<p>yes</p>



<a name="203994920"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Making%20quickfixes%20out%20of%20assists/near/203994920" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Timo Freiberg <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Making.20quickfixes.20out.20of.20assists.html#203994920">(Jul 15 2020 at 18:34)</a>:</h4>
<p>I'm still struggling to find a place where that could be added though... maybe something inside <code>InferenceContext::infer_expr_inner</code>?</p>



<a name="203997033"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Making%20quickfixes%20out%20of%20assists/near/203997033" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Florian Diebold <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Making.20quickfixes.20out.20of.20assists.html#203997033">(Jul 15 2020 at 18:52)</a>:</h4>
<p>yeah, I think adding such diagnostics requires a bunch of design work and refactoring, because currently names get resolved in lots of places depending on where they are</p>



<a name="204002843"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/185405-t-compiler/rust-analyzer/topic/Making%20quickfixes%20out%20of%20assists/near/204002843" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Timo Freiberg <a href="https://rust-lang.github.io/zulip_archive/stream/185405-t-compiler/rust-analyzer/topic/Making.20quickfixes.20out.20of.20assists.html#204002843">(Jul 15 2020 at 19:40)</a>:</h4>
<p>damnit... okay that dampens my enthusiasm a little :)</p>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>